#! /bin/bash

export LANG=en_US.UTF-8

pid=$*
psinfo=`ps aux | grep $pid|grep java|grep -v ps|grep -v grep`
config_path=`echo $psinfo|awk -F ' ' '{for(i=1;i<NF;++i){if(index($i,"-cp")==1)print $(i+1)}}'|awk -F ':' '{print $1}'`
cd  $config_path/../
echo `pwd`/